import asyncio

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

from selenium.webdriver.support.wait import WebDriverWait

options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
driver =webdriver.Chrome(options=options)
wait = WebDriverWait(driver, 30)

driver.get("http://192.168.77.101:8100")
time.sleep(10)
driver.save_screenshot('login.png')
# driver.get("https://www.hao123.com/")
input_elements = driver.find_elements(By.CSS_SELECTOR, "[placeholder='账号/邮箱']")
input_elements[0].send_keys('admin')
# 定位用户名和密码输入框
input_elements = driver.find_elements(By.CSS_SELECTOR, "[placeholder='密码']")
input_elements[0].send_keys('DataEase@123456')
btn = driver.find_elements(By.TAG_NAME, "button")
btn[0].click()
time.sleep(10)
driver.save_screenshot('main.png')